using UnityEngine;
using System.Collections;

public class PlayerIO : IGlobalIO {
	GlobalAccess globals;
	GameObject player;
	
	public PlayerIO() {
		this.globals = new GlobalAccess();
	}
	
	public void UpdateIO() {
		if (this.globals == null) {
			return;
		}
		
		if (this.player == null) {
			this.player = GameObject.Find ("Player");
		}
		
		if (this.player == null) {
			return;
		}
		
		if (Input.GetButtonUp ("BasicAttack")) {
			this.player.BroadcastMessage("BasicAttack");
		} else if (Input.GetButtonUp("BasicDefend")) {
			this.player.BroadcastMessage("BasicDefend");
		}
	}
}
